From: Chad Horohoe Date: Wed, 22 Sep 2010 19:19:47 +0000 (+0000) Subject: Skip new object construction if it's going to be the same X-Git-Tag: 1.31.0-rc.0~34830 X-Git-Url: http://git.cyclocoop.org/%22.%24info%5B?a=commitdiff_plain;h=4a025d936a18345d4e5c4157082d6163ebc738bc;p=lhc%2Fweb%2Fwiklou.git Skip new object construction if it's going to be the same --- diff --git a/includes/Message.php b/includes/Message.php index 44c72ad24f..df43339dbd 100644 --- a/includes/Message.php +++ b/includes/Message.php @@ -158,7 +158,9 @@ class Message { if( $lang instanceof Language ){ $this->language = $lang; } elseif ( is_string( $lang ) ) { - $this->language = Language::factory( $lang ); + if( $this->language->getCode() != $lang ) { + $this->language = Language::factory( $lang ); + } } else { $type = gettype( $lang ); throw new MWException( __METHOD__ . " must be "